<?php
/**
 * 备货sku销售比例
 * (model)
 */
namespace App\Models\Stocking;

use Illuminate\Database\Eloquent\Model;
class StockingSkuRatio extends Model
{
    protected $table = 's_stocking_sku_ratio';

    protected $guarded = [];

    public static function getRatio($key){
        $ratio = self::query()
            ->where('area_psku',$key)
            ->value('ratio');
        return $ratio ?: 0;
    }
}
